package org.qengine.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.qengine.entity.PaperInfoEntity;
import org.qengine.entity.UserAnswersEntity;

import java.util.List;

public interface PaperInfoService extends IService<PaperInfoEntity> {

    /**
     * 根据 stuID 查询 paperID 列表 并更新到 stuInfo 表中
     * @param stuID 学生ID
     * @return paperID 列表
     */
    List<Long> getPaperIDsByStuID(Long stuID);


    /**
     * 根据试卷id获取试卷信息
     * @param paperID
     * @return
     */
    PaperInfoEntity getPaperInfoById(Long paperID);

    /**
     * 新增/修改试卷信息
     * @param paperInfo
     */
    int updatePaperInfo(PaperInfoEntity paperInfo);

    /**
     * 删除试卷信息
     * @param paperID
     * @return
     */
    int deletePaperInfo(Long paperID);

    List<PaperInfoEntity> getPaperInfo();

    public PaperInfoEntity updateAnsStatus( UserAnswersEntity answer);

    public PaperInfoEntity updateScore( UserAnswersEntity answer);


    public UserAnswersEntity getStuAnswersByStuIDAndPaperID(Long stuID, Long paperID);
    public boolean updateStuAnswersByStuIDAndPaperID(UserAnswersEntity userAnswersEntity);
    public boolean deleteStuAnswersByStuIDAndPaperID(Long stuID, Long paperID);
}
